import React from 'react';
import { Routes, Route } from 'react-router-dom';
import route from '../router';

function App() {
  return (
    <div className="App">
      <header className="App-header">
        <Routes>
          {(route || []).map((router, index) => {
            const Comp = router.component;
            return <Route path={router.path} element={<Comp />} key={index}></Route>;
          })}
        </Routes>
      </header>
    </div>
  );
}

export default App;
